<?php
/**
 * @author SNOWTAM
 * @purpose Parsing customtext.txt, displaying information on a simple page. Code prepared for   *  *          mysql connection.
 * @created 2008-12-17
 */
$weather = file("http://89.253.68.42/customtextout.txt");
//$rader = explode("|", $weather);
$last_row = end($weather);
//$conn = mysql_connect('server', 'user', 'password') or die ('Error connecting to mysql');
//mysql_select_db('db', $conn) or die ('Error connecting to database');
echo $last_row;
echo "<br><br><br>";

$last_row_array = explode("|", $last_row);
echo "Tid $last_row_array[0]/$last_row_array[1]/$last_row_array[2] Kl $last_row_array[3]:$last_row_array[4] <br><br>Temp $last_row_array[5]<br><br>Rh $last_row_array[6]%<br><br>Vind $last_row_array[8] m/s<br><br>Max Vind $last_row_array[9]";


//for($i = 0; $i < count($weather); ++$i) {
//$last_row = end($rader);
//
//$rad = split(" ", $weather[$i]);

//$Tid = $rad[0]."-".$rad[1]."-".$rad[2]." ".$rad[3].":".$rad[4].":00";
//$lvs_sql="replace into weather_station ( date_stamp,temperatur,humidity,weahter,wind_av,wind_gust) values ( '".$Tid."','".substr($rad[5],0,-2)."',".$rad[6].",'".$rad[7]."',".$rad[8].",'".$rad[9]."');";
//echo $lvs_sql."<BR>";
//mysql_query($lvs_sql);
//echo $tid;

//echo $last_row[0];
//echo "$x <br>";
//echo $rader[1];

//}


?>